package o;

import android.content.Context;
import android.os.RemoteException;
import com.huawei.appmarket.framework.coreservice.BaseIPCResponse;
import com.huawei.appmarket.framework.coreservice.DataHolder;
import com.huawei.appmarket.framework.coreservice.Status;
import com.huawei.appmarket.service.externalservice.distribution.referrer.request.QueryReferrerIPCRequest;
import com.huawei.appmarket.service.externalservice.distribution.referrer.response.QueryReferrerResponse;
import com.huawei.appmarket.support.storage.referrer.AppReferrerRecord;
import java.util.LinkedHashMap;
import java.util.List;

public class dzk implements dhe<QueryReferrerIPCRequest, QueryReferrerResponse> {
    public void ˊ(Context context, DataHolder<QueryReferrerIPCRequest> dataHolder, dgz o_dgz) throws RemoteException {
        ॱ(dataHolder);
        Status status = new Status();
        status.ˋ(0);
        BaseIPCResponse ॱ = ॱ();
        ॱ(((QueryReferrerIPCRequest) dataHolder.ˊ()).ˋ(), dataHolder.ˏ().ˋ(), ॱ);
        status.ˏ(ॱ);
        o_dgz.ॱ(status);
    }

    public QueryReferrerResponse ॱ() {
        return new QueryReferrerResponse();
    }

    private void ॱ(String str, String str2, QueryReferrerResponse queryReferrerResponse) {
        Logger.ˎ("QueryReferrerProcess", "pkgName = " + str + " mediaPkg=" + str2);
        List ˊ = eun.ˏ().ˊ(str, str2);
        if (ˊ.size() == 1) {
            AppReferrerRecord appReferrerRecord = (AppReferrerRecord) ˊ.get(0);
            queryReferrerResponse.ॱ(dof.ˊ(appReferrerRecord.ˎ()));
            queryReferrerResponse.ˋ(appReferrerRecord.ˋ());
            queryReferrerResponse.ˏ(appReferrerRecord.ॱ());
            return;
        }
        Logger.e("QueryReferrerProcess", "unable to get referrer, size=" + ˊ.size());
    }

    private void ॱ(DataHolder<QueryReferrerIPCRequest> dataHolder) {
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        linkedHashMap.put("pkgName", ((QueryReferrerIPCRequest) dataHolder.ˊ()).ˋ());
        dgh.ˋ("380201", linkedHashMap);
    }
}
